package com.lanhai.webservice.task;

import com.lanhai.webservice.service.WebLogInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service
@EnableScheduling
public class ScheduledTask {

    @Autowired
    private WebLogInfoService webLogInfoService;



    //每天定时删除日志 因为数据量大所以每天定时删除4次
    @Scheduled(cron = "0 10 0,1,2,3 * * ?")
    public void deletelog(){
        int count= webLogInfoService.deleteTimeOutLog();
        System.out.println("定时清除日志,共删除"+count+"条数据");
    }

}
